1. Field of Disclosure
This disclosure generally relates to the fields of dynamic computer program languages and just-in-time code generation. Specifically, the disclosure describes a system, method, and process for the optimized execution of dynamic computer program languages through context tracking and just-in-time code generation.
2. Description of the Related Art
Dynamic languages such as PHP: Hypertext Preprocessor (PHP), Python, Ruby, and Perl have been adopted heavily for web development and applications development because they allow for high developer productivity. There are many features of these languages that contribute to their productive characteristics, but two of the most important are runtime typing and the ability to evaluate new data as code dynamically. These characteristics allow developers to write code that can be used more flexibly than static code written in a language such as C, Java, or C++. For example, the dynamic languages enable more flexible development practices by allowing developers to conditionally generate new executable code from existing code, at runtime, to handle novel data.
The disadvantage of dynamic languages is that their execution is typically significantly slower than that of static languages (which may enforce compile time static typing and which may not allow dynamic code execution). Because the types of functions and variables are known at compile time, and because the full scope of executable code is known by the compiler, a static language can be translated to machine code efficiently prior to a program's execution. In the case of a dynamic language, the full scope of the executable code is not known, and the types of many functions and variables may not be known until the moment the code is executed. For these reasons a dynamic language cannot be completely converted to machine code prior to execution. In addition, even runtime translation to machine code is often impractical because the just-in-time compilation process may itself require significant execution resources leading to diminished performance during execution.